package com.googlecode.moneyManager.web.controller
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.{RequestParam, RequestMapping}
import org.springframework.ui.ModelMap
import com.googlecode.moneyManager.web.ReadData


@Controller
class HelloWorldController {

  @RequestMapping(Array("/hello.do"))
  def welcomeHandler(@RequestParam("id") ownerId:Int):ModelMap = {
    val persons = ReadData.testPersons2()
    val model = new ModelMap("id",ownerId)
    model.addAttribute("persons",persons)
    model
  }


}